<?php
/**
 * @filesource					CommonModel.class.php
 * @desc						公共模型类
 * 
 * @author						houyining
 * @copyright					hou.yining@gmail.com
 * @date						2011-05-04
 */

class CommonModel extends Model{
	
	//获取当前操作人员的姓名
	public function getCurrentOperatorName(){
		$operator_id = get_current_operator();
		
		$admin_user = new AdminUserModel();
		$operator = $admin_user->field("account")->where(array('id' => $operator_id))->find();
		return $operator['account'];
	}
	
	//获取开始时间
	public function getStartTime(){
		$start_time   = $_POST['start_time'];
		return strtotime($start_time);
	}
	
	//获取结束时间
	public function getEndTime(){
		$start_time = $this->getStartTime();
		$reserve_time = $_POST['during_time'];
		return $start_time + $reserve_time*24*60*60;
	}	
}
?>